﻿#region
/* ===============================================
 * 作者：guopeng           时间：2012/4/2 19:46:06
 * 
 * 
 * 类描述：
 * 
 * 
 * =============================================== */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using ueEngine.Biz.Inf.Entities.DBSupport;
using ueEngine.Framework.Exception;

namespace ueEngine.Biz.Inf.Entities
{
    /// <summary>
    /// 被代理招募的企业
    /// </summary>
    [Table("DepositCompany")]
    public class DepositCompany : BaseEntity<DepositCompany>
    {
        public DepositCompany() { }
        public override DepositCompany Get(System.Linq.Expressions.Expression<Func<DepositCompany, bool>> where)
        {
            using (Context ctx = new Context())
            {
                var item = ctx.DepositCompany.FirstOrDefault(where);
                if (item != null)
                {
                    this.Id = item.Id;
                    this.Agent = item.Agent;
                    this.CompanyDetail = item.CompanyDetail;
                    this.CompanyName = item.CompanyName;
                    this.PostDate = item.PostDate;
                    this.CompanyBusiness =item.CompanyBusiness;
                    this.CompanyType =item.CompanyType;
                    this.CompanyDimensions = item.CompanyDimensions;
                    this.Templete = item.Templete;
                    return this;
                }
                return null;
            }
        }

        #region Fileds
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        /// 所属代理人
        /// </summary>
        [Column(TypeName="varchar")]
        [StringLength(200)]
        public string Agent { get; set; }
        /// <summary>
        /// 企业名
        /// </summary>
        [Column(TypeName = "nvarchar")]
        [StringLength(200)]
        public string CompanyName { get; set; }
        /// <summary>
        /// 企业详情
        /// </summary>
        [Column(TypeName = "varchar")]
        public string CompanyDetail { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        [Column(TypeName="datetime")]
        public DateTime PostDate { get; set; }
        /// <summary>
        /// 行业分类
        /// </summary>
        [Column(TypeName="int")]
        public int CompanyBusiness { get; set; }
        /// <summary>
        /// 企业类型
        /// </summary>
        [Column(TypeName="int")]
        public int CompanyType { get; set; }
        /// <summary>
        /// 企业规模
        /// </summary>
        [Column(TypeName="int")]
        public int CompanyDimensions { get; set; }
        /// <summary>
        /// 是否为模板
        /// </summary>
        [Column(TypeName="bit")]
        public bool Templete { get; set; }
        #endregion
    }
}
